// 评论模块
const router =  require('express').Router()
const query = require('../mysql/index');

/**
 * 获取用户权限
 */
router.get("/",async(req,res)=>{
    try {
        let sql = "select status from user_table where id = ?";
        let data = await query(sql,req.query.id);
        res.json({
            code:data[0].status == 1?200:400,
        })
    } catch (error) {
        res.json({
            code:400,
            
        })
    }
})
router.get("/getPower",async(req,res)=>{
    if(req.session.user){
        res.json({code:200})
    }else{
        res.json({code:400})
    }
})

module.exports = router;